package io;

import java.io.*;

/**
 * 对象输入流测试
 */
public class ObjectInPutStreamTest {
    public static void main(String[] args) {
        readObject();
    }

    private static void readObject() {
        try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream("/Users/luchuan/IdeaProjects/java-test/person.txt"))) {
            final Person p = (Person)ois.readObject();
            System.out.println(p);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
